#pragma once
#include"HashTable.h"
namespace zy
{
	template<class k, class Hash = hash_bucket::HashFunc<k>>
	class unordered_set
	{
	public:
		struct SetKeyOfT
		{
			const k& operator()(const k& key)
			{
				return key;
			}
		};
		typedef typename hash_bucket::HashTable<k, const k, SetKeyOfT, Hash>::Iterator iterator;
		typedef typename hash_bucket::HashTable<k, const k, SetKeyOfT, Hash>::const_Iterator const_iterator;

		iterator begin()
		{
			return _ht.Begin();
		}
		iterator end()
		{
			return _ht.End();
		}
		const_iterator begin() const
		{
			return _ht.Begin();
		}
		const_iterator end() const
		{
			return _ht.End();
		}

		pair<iterator, bool> insert(const k& key)
		{
			return _ht.Insert(key);
		}
		iterator find(const k& key)
		{
			return _ht.Find(key);
		}
		bool erase(const k& key)
		{
			return _ht.Erase();
		}
	private:
		hash_bucket::HashTable<k, const k, SetKeyOfT, Hash> _ht;
	};
}